#ifndef PROCESSES_H
#define PROCESSES_H

#include <QObject>
#include <QMap>
#include <QProcess>
class QUdpSocket;

class Processes : public QProcess
{
    Q_OBJECT
public:
    explicit Processes(QByteArray parAdapName,quint16 parPort,QObject *parent = 0);
    ~Processes();
signals:
    void sigErrorInfo(QString errorStr);
    void sigProcessStarted(QByteArray processName);
    void sigProcessError(QByteArray processName,QByteArray strError);
    void sigProcessFinished(QByteArray processName,int exitCode,QByteArray strStatus);
    void sigProcessStateChanged(QByteArray processName,QByteArray strState);

private slots:
    void slotStarted();
    void slotError(QProcess::ProcessError errorCode);
    void slotFinished(int exitCode,QProcess::ExitStatus exitStatus);
    void slotStateChanged(QProcess::ProcessState pstate);

    void slotProcessShow(QByteArray processName); //显示进程的界面。如果进程不在运行，则启动进程
    void slotProcessHide(QByteArray processName);   //隐藏进程的界面
private:
    QByteArray adapterName;
    quint16  udpPort;
    QUdpSocket *udpSocket;

};

#endif // PROCESSES_H
